home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Technotools
/
Technotools (Chestnut CD-ROM)(1993).ISO
/
lang_c
/
bc_ti
/
ti653.asc
< prev
next >
Wrap
Text File
|
1992-02-24
|
3KB
|
133 lines
PRODUCT : Borland C NUMBER : 653
VERSION : All
OS : PC DOS
DATE : February 25, 1992 PAGE : 1/2
TITLE : Abbreviated DLL Generation Procedure
Below is all the code and information necessary to create a
Dynamic Link Library file using Borland C++ 2.0 for Windows. It
includes a sample C source file as well as the module definition
file (.DEF). Instructions on how to configure Borland C++ 2.0
and compile the C source code is also listed below. Please note
this is the bare minimum amount of code needed to create a DLL
file and will actually do nothing if loaded by a Windows EXE
file.
//...............................................................
// DLLTEST.C -- notice we have a LIBMAIN function instead of
WINMAIN
#include <windows.h> // Include the Windows function prototypes
int FAR PASCAL LibMain(HANDLE hInstance, WORD wDataSeg,
WORD wHeapSize, LPSTR lpszCmdLine)
{
// Any code that needs to be executed only once when the
// DLL gets loaded by Windows goes here.
return 1; // Success (or 0 for Failure)
}
int FAR PASCAL WEP(int nParameter)
{
return 1;
}
//...............................................................
// DLLTEST.DEF -- notice we have a LIBRARY statement instead of
// EXETYPE as well as a DATA statement ending in
// the word SINGLE.
LIBRARY DLLTEST
DESCRIPTION 'How to create a Dynamic Link Library'
CODE PRELOAD MOVEABLE DISCARDABLE
DATA PRELOAD MOVEABLE SINGLE
EXPORTS
LibMain @1
WEP @2
//...............................................................
PRODUCT : Borland C NUMBER : 653
VERSION : All
OS : PC DOS
DATE : February 25, 1992 PAGE : 2/2
TITLE : Abbreviated DLL Generation Procedure
To compile the test .DLL file type:
BCC -WD dlltest.c <enter>
//................................................................
Make sure that Borland C++ 2.0 is in your path prior to both
Microsoft C and any earlier version of Turbo C++.
Example: path=c:\dos;c:\borlandc\bin;c:\xtgold;c:\tc\bin
//................................................................
Make sure the TURBOC.CFG file being used has the correct path to
both library and include files.
Example:
-Ic:\borlandc\include
-Lc:\borlandc\lib